package db.dao;

/***
 *
 */


import db.connectionPool.DbConnectionManager;
import java.util.ArrayList;
/**
 *
 * @author Romms
 */
public abstract class AbstractDAO<T>{
    protected  DbConnectionManager connectionManager;
    private String query;

    protected String getQuery() {
        return query;
    }

    protected void setQuery(String query) {
        this.query = query;
    }
   

    public AbstractDAO(){
        connectionManager=DbConnectionManager.getInstance();
    }

    public abstract void add(T entity)throws Exception;

    public abstract void deleteWhere(String condition)throws Exception;

    public abstract void updateWhere(T entity, String condition)throws Exception;

    protected abstract ArrayList<T> select()throws Exception;

    public abstract ArrayList<T> selectAll()throws Exception;

    public abstract ArrayList<T> selectWhere(String condition)throws Exception;



}
